﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CPUx86 =  Cosmos.Assembler.x86;
namespace Optimus
{
    public class xHAL :HAL
    {
        public static OTSS aTSS = new OTSS();
        public struct OTSS
        {
           public UInt32 EAX;
           public UInt32 EBX;
           public UInt32 ECX;
           public UInt32 EDX;
           public UInt32 ESI;
           public UInt32 EDI;
           public UInt32 EBP;
           public UInt32 ESP;
           public UInt32 CS;
           public UInt32 ES;
           public UInt32 SS; 
           public UInt32 FS;
           public UInt32 GS;
           public UInt32 CR3;
        }
        public static void Exp()
        {
            SwitchTo();
        }
        public static UInt32 CSInfo()
        {
            return ReadCSInfo();
        }
        public static UInt32 EFLAGSInfo()
        {
            return ReadEFLAGSInfo();
        }
        public static UInt32 ErrorInfo()
        {
            return ReadErrorInfo();
        }
        public static UInt32 GetEAX()
        {
            return SaveEAX();
        }
        public static UInt32 GetEBX()
        {
            return SaveEBX();
        }
        public static UInt32 GetECX()
        {
            return SaveECX();
        }
        public static UInt32 GetEDX()
        {
            return SaveEDX();
        }
        public static UInt32 GetESI()
        {
            return SaveESI();
        }
        public static UInt32 GetEDI()
        {
            return SaveEDI();
        }
        public static UInt32 GetEBP()
        {
            return SaveEBP();
        }
        public static UInt32 GetESP()
        {
            return SaveESP();
        }
        public static void LoadADDR(UInt32 ADDR)
        {
            LoadAddress(ADDR);
        }
        public static void InitialiseMultitasking()
        {
            StartMultitask();
        }
        public static void InitialiseMultitasking2()
        {
            StartMultitask2();
        }
        public static UInt32 StartExperiment()
        {
            return Experiment(0xFFAAFFAA);
        }
    }
}
